home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
winview
/
winview.frm
< prev
next >
Wrap
Text File
|
1999-09-15
|
21KB
|
686 lines
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form Winview
Caption = "WinView"
ClientHeight = 3555
ClientLeft = 1335
ClientTop = 1635
ClientWidth = 11280
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
LinkMode = 1 'Source
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 237
ScaleMode = 3 'Pixel
ScaleWidth = 752
Begin VB.PictureBox picCatch
Height = 375
Left = 6240
ScaleHeight = 315
ScaleWidth = 615
TabIndex = 8
Top = 3000
Width = 675
End
Begin VB.CommandButton cmdPosition
Caption = "Position"
Height = 435
Left = 240
TabIndex = 2
Top = 2460
Width = 975
End
Begin VB.CommandButton cmdSize
Caption = "Size"
Height = 435
Left = 1320
TabIndex = 3
Top = 2460
Width = 975
End
Begin VB.CommandButton cmdClassInfo
Caption = "ClassInfo"
Height = 435
Left = 2400
TabIndex = 4
Top = 2460
Width = 975
End
Begin VB.CommandButton cmdWinStyles
Caption = "WinStyles"
Height = 435
Left = 3480
TabIndex = 5
Top = 2460
Width = 1035
End
Begin VB.CommandButton cmdFlash
Caption = "Flash"
Height = 435
Left = 4620
TabIndex = 6
Top = 2460
Width = 975
End
Begin VB.CommandButton cmdCtlName
Caption = "CtlName"
Height = 435
Left = 240
TabIndex = 7
Top = 3000
Width = 975
End
Begin VB.CommandButton cmdParent
Caption = "Parent"
Height = 435
Left = 1320
TabIndex = 1
Top = 3000
Width = 975
End
Begin ComctlLib.ListView lvwWindows
Height = 2010
Left = 240
TabIndex = 10
Top = 360
Width = 10770
_ExtentX = 18997
_ExtentY = 3545
View = 3
LabelEdit = 1
Sorted = -1 'True
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 327682
ForeColor = -2147483640
BackColor = 16777215
BorderStyle = 1
Appearance = 1
NumItems = 4
BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
Key = ""
Object.Tag = ""
Text = "hWnd"
Object.Width = 2999
EndProperty
BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
SubItemIndex = 1
Key = ""
Object.Tag = ""
Text = "ExePath"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(3) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
SubItemIndex = 2
Key = ""
Object.Tag = ""
Text = "Class"
Object.Width = 3175
EndProperty
BeginProperty ColumnHeader(4) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
SubItemIndex = 3
Key = ""
Object.Tag = ""
Text = "WindowText"
Object.Width = 1587
EndProperty
End
Begin VB.Label lblHere
Alignment = 1 'Right Justify
Caption = "Click Here For point mode 2 -->"
Height = 255
Left = 3420
TabIndex = 9
Top = 3120
Width = 2835
End
Begin VB.Label lblMsg
Height = 195
Left = 240
TabIndex = 0
Top = 120
Width = 5415
End
Begin VB.Menu mnuLoadList
Caption = "LoadList"
Begin VB.Menu mnuTopLevel
Caption = "&TopLevel"
Shortcut = ^T
End
Begin VB.Menu mnuChildren
Caption = "&Children"
Shortcut = ^C
End
Begin VB.Menu mnuOwned
Caption = "&Owned"
Shortcut = ^O
End
Begin VB.Menu MenuPointed
Caption = "&Pointed"
Shortcut = ^P
End
Begin VB.Menu mnuClear
Caption = "C&lear"
End
End
End
Attribute VB_Name = "Winview"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Enum enPointMode
enPointModeOff = 0
enPointModeMenu = 1
enPointModePic = 2
End Enum
Private genPointMode As enPointMode
Private Sub Form_Load()
SetListviewStyle lvwWindows.hWnd, LVS_EX_FULLROWSELECT, True
End Sub
' If point mode was started via menu, record the current window
' in the listbox
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If genPointMode <> enPointModeMenu Then Exit Sub
AddToList lblMsg.Caption
genPointMode = enPointModeOff
lblMsg.Caption = ""
' If capture is still held, release it
If GetCapture() = Me.hWnd Then ReleaseCapture
End Sub
' If point mode was started via PictureBox, record the current window
' in the listbox
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If genPointMode <> enPointModePic Then Exit Sub
AddToList lblMsg.Caption
genPointMode = enPointModeOff
lblMsg.Caption = ""
' If capture is still held, release it
If GetCapture() = Me.hWnd Then ReleaseCapture
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim tPT As POINTAPI
Dim hWndFound As Long
' Only record window if we're in point mode
If genPointMode = enPointModeOff Then Exit Sub
' convert clienet-coordinates to logical-coordinates
tPT.x = x
tPT.y = y
ClientToScreen Me.hWnd, tPT
' get Window-Handle and Description
hWndFound = WindowFromPoint(tPT.x, tPT.y)
lblMsg.Caption = GetWindowDesc(hWndFound)
End Sub
'------------------------------------------------------------------------------
' Show the position of the selected window
Private Sub cmdPosition_Click()
Dim tRECTWnd As RECT
Dim hWnd As Long
Dim sOut As String
Dim sTitle As String
If lvwWindows.SelectedItem Is Nothing Then
MsgBox "No windows selected", 0, "Error"
Exit Sub
End If
sTitle = lvwWindows.SelectedItem
hWnd = GetHWnd(sTitle)
' Get the rectangle describing the window
GetWindowRect hWnd, tRECTWnd
If IsIconic(hWnd) Then sOut = "Is Iconic" & vbCrLf
If IsZoomed(hWnd) Then sOut = sOut & "Is Zoomed" & vbCrLf
If IsWindowEnabled(hWnd) Then
sOut = sOut & "Is Enabled" & vbCrLf
Else
sOut = sOut & "Is Disabled" &